#!/usr/local/env python3
#author:fonzie
import os
import sys

#把当前项目所在目录添加到环境变量中
evn_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(evn_path)

from flask_script import Manager, Server
from SimpleManager import SimpleManager, db

manager = Manager(SimpleManager)
manager.add_command("server", Server())


@manager.shell
def make_shell_context():
    return dict(SimpleManager=SimpleManager, db=db)

if __name__ == "__main__":
    manager.run()